package com.ruoyi.mongo.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class MongoMiddleService {

    // 注入主数据库的 MongoTemplate
    private final MongoTemplate mongoTemplate;

    public MongoMiddleService( @Qualifier("primaryMongoTemplate")
                               MongoTemplate primaryMongoTemplate) {
        this.mongoTemplate = primaryMongoTemplate;
    }
}
